package be.xios.ti.droodle;

import java.awt.*;

/**
 * @author Kris Hermans
 */
public class LineShape extends Shape {
	private int x2,y2;
	
	public LineShape(Color color, int x, int y, int x2, int y2, int size, boolean filled) {
		super(color,x,y,size,filled);
		this.x2 = x2;
		this.y2 = y2;
	}
	
	public LineShape() {
		super();
		x2 = 0;
		y2 = 0;
	}
	
	protected void draw(Graphics g) {
		Graphics2D g2d = (Graphics2D)g;
		
		g2d.setColor(getColor());
		g2d.setStroke(new BasicStroke((float)getSize()));
		g2d.drawLine(getX(),getY(),x2,y2);
	}

	/**
	 * @return Returns the x2.
	 */
	public int getX2() {
		return x2;
	}
	/**
	 * @param x2 The x2 to set.
	 */
	public void setX2(int x2) {
		this.x2 = x2;
	}
	/**
	 * @return Returns the y2.
	 */
	public int getY2() {
		return y2;
	}
	/**
	 * @param y2 The y2 to set.
	 */
	public void setY2(int y2) {
		this.y2 = y2;
	}
}
